import { shareAppMessageSet } from "../../../utils/config";
import { dataCollection } from "../../../utils/dataCollection";
import { CoachProps } from "../../../utils/type";
// pages/drivingSchool/coach/coach.ts
Page({

  /**
   * 页面的初始数据
   */
  data: {
    coach:<CoachProps>{},
    refresherTriggered:false,
    themeCode:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
   const coach:CoachProps =  wx.getStorageSync('coach')
   console.log('coach',coach)
   this.setData({
     coach,
     themeCode:wx.getStorageSync('themeCode')
   })
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },
  onHide(){
    dataCollection.setPageMapData('leave')
  },
  onUnload(){
    dataCollection.setPageMapData('leave')
  },
  onShow(){
    dataCollection.setPageMapData('enter','教练详情')
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
    return {...shareAppMessageSet()}
  },
  
})